<?php
/**
 * Page blogpost
 * 
 * $_GET	seed_id
 * 			view
 * 			template
 */
defined("_ENTRY_") or die("Restricted Access!");

define("BLOGPOST_DEFAULT_VIEW", "post");

import('core.site.Page');
import('core.site.Model');
import('core.blog.Blogpost');

import("includes.debug");

$db = getDB();

// Create the Model /////////////////////////////////////////////////////////////////////////////

$seed = new Seed( &$db, NULL, NULL, get_var('seed_id', 'get', NULL) );

$blogpost = $seed->getObject();
$blogpost->setSeed( $seed );

$model = new Model( $blogpost->getTitle(), &$blogpost );
$model->setView( get_var('view', 'get', BLOGPOST_DEFAULT_VIEW) );

// Page object and settings /////////////////////////////////////////////////////////////////////

$page = new Page(SITE_NAME." - ".$blogpost->getTitle(), &$model);
$page->setTemplate( get_var('template', 'get', 'default'));

$page->display();

?>